using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using QLNhaSach.BUS.DTO;

namespace QLNhaSach.DAO
{
    public class TheLoaiDAO
    {
        public static DataTable DSTheLoai()
        {
            string sql = "SELECT * FROM TheLoai";
            return Config.AccessHelper.ExecuteQuery(sql);
        }

        public static bool ThemTheLoai(TheLoaiDTO tl)
        {
            try
            {
                string sql = "INSERT INTO TheLoai(TenTL) VALUES ('" + tl.TenTL + "')";
                Config.AccessHelper.ExecuteNonQuery(sql);
                return true;
            }
            catch
            {
                return false;
            }
        }
    }
}
